# Contributor: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
# Maintainer: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
pkgname=vice
pkgver=3.6.1
pkgrel=0
pkgdesc="emulates the C64/DTV, C128, VIC20, almost all PETs, PLUS4 and CBM-II"
url="http://vice-emu.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
makedepends="gtk+3.0-dev glew-dev giflib-dev ffmpeg4-dev jpeg-dev libpng-dev alsa-lib-dev
	linux-headers texinfo automake autoconf bison flex xa bdftopcf mkfontdir
	bash"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/vice-emu/vice-$pkgver.tar.gz
	disable-fc-cache.patch
	fix__u_char.patch"

prepare() {
	sed -i 's/\r//' "$builddir/src/opencbm.h"
	default_prepare
	sed -i 's/lib64/lib/g' configure.ac
	autoreconf -fi
}

build() {
	./configure --prefix=/usr \
		--libdir=/usr/lib \
		--enable-native-gtk3ui \
		--enable-x64 \
		--disable-no-pic \
		--disable-pdf-docs \
		--without-pulse \
		--enable-external-ffmpeg
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

check() {
	make -C "$builddir" check
}

sha512sums="
9aeb1c84dc71976d12a9907d60c637ec4cc938aad103340b70a13906bbf2bebab579edc78221c7fba47f0750be3f9ded947200b42fcfc8a9169fb4bb9f288cb7  vice-3.6.1.tar.gz
ed6fee34eefcb04c42b4575591dfeffca8548eae354dee66dabdbc4abac0311cbbedcdc07cdfcb01da4840d57ab331a31583e17160820462a2c064835a75d75d  disable-fc-cache.patch
3132be50c402068865b530ed9df71a073012623ce48e3fa162f33af7bdcdd6d890590955868bb5591e018c17359e860ccff9eb0cde9bfd99582ac921400e8f2f  fix__u_char.patch
"
